package pub.tbc.mybatis.domain;

import lombok.Getter;

/**
 * @author tbc on 2017/5/10 16:38:13.
 */
@Getter
public enum Sex {
    MALE(1, "男", "MALE"), FEMALE(2, "女", "FEMALE");

    private int id;
    private String name;
    private String nameEn;


    Sex(int id, String name, String nameEn) {
        this.id = id;
        this.name = name;
        this.nameEn = nameEn;
    }

    public static Sex getSex(int id) {
        if (id == 1)
            return MALE;
        else if (id == 2)
            return FEMALE;
        return null;
    }

}
